<div class="col-lg-9">
<h1> <%= translation('like.index.recent_likes') %> </h1>
<% if logged_in_as(['admin', 'moderator']) %>
	<p>Users marked in <b>red</b> are banned</p>
<% end %>
<table class="table">
	<tr>
		<th><%= translation('like.index.user') %></th>
		<th><%= translation('like.index.liked') %></th>
		<% if logged_in_as(['admin', 'moderator']) %>
			<th><%= translation('like.index.action') %></th>
		<% end %>
	</tr>
	<% @likes.each do |like| %>
		<tr>
			<td>
				<% if logged_in_as(['admin', 'moderator']) %>

					<a rel="tooltip" title="<%= like.user.bio %>" class="user" href="/profile/<%= like.user.name %>" style = "color: <%= like.user.status.zero? ? 'red' : 'black' %>" > <i class="fa fa-user" aria-hidden="true" style = "color: <%= like.user.status.zero? ? 'red' : 'black' %>"></i><%= like.user.name %></a>

				<% else %>

					<a href="/profile/<%= like.user.name %>" style = "color: <%= like.user.status.zero? ? 'red' : 'black' %>"><i class="fa fa-user" aria-hidden="true" style = "color: <%= like.user.status.zero? ? 'red' : 'black' %>"></i><%= like.user.name %></a>

				<% end %>
			</td>

			<td> <a href="/wiki/<%= like.node.title %>"><%= like.node.title %></a></td>

			<% if logged_in_as(['admin', 'moderator']) %>
				<td>
					<% if like.user == current_user %>
						<b> - </b>
					<% else %>
						<% if like.user.status == 1 %>
							<a data-confirm="<%= translation('users.profile.confirm_ban_user',{},false) %>" href="/ban/<%= like.user.id %>" class="btn btn-outline-secondary"><i class="fa fa-ban"></i> <%= translation('users.profile.ban_user') %></a>
			          	<% else %>
			          		<a href="/unban/<%= like.user.id %>" class="btn btn-outline-secondary"><i class="fa fa-thumbs-up"></i> <%= translation('users.profile.unban_user') %></a>
			          	<% end %>
		          <% end %>
				</td>
			<% end %>
		</tr>
	<% end %>
</table>
<% if @pagy_a %>
	<%= raw pagy_bootstrap_nav @pagy_a if @paginated %>
<% else %>
	<%= will_paginate @likes, renderer: WillPaginate::ActionView::BootstrapLinkRenderer if @paginated %>
<% end %>
</div>
